home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / TransSkel 3.24 / Source / Control Stuff / SkelEraseButtonOutline.c < prev    next >
Text File  |  1996-01-17  |  785b  |  36 lines

  1. /*
  2.  * Erase the heavy outline around a push button.  This simply draws
  3.  * the outline in white.  Apparently this works correctly even when
  4.  * the background is a different color.  Maybe "white pen" really
  5.  * means "background color pen"?
  6.  */
  7.  
  8. # include    "TransSkel.h"
  9.  
  10.  
  11. # define    normalHilite    0
  12. # define    dimHilite        255
  13.  
  14.  
  15. pascal void
  16. SkelEraseButtonOutline (ControlHandle ctrl)
  17. {
  18. GrafPtr        oldPort;
  19. PenState    penState;
  20. Rect        r;
  21. short        curvature;
  22.  
  23.     GetPort (&oldPort);
  24.     SetPort ((**ctrl).contrlOwner);
  25.     r = (**ctrl).contrlRect;
  26.     InsetRect (&r, -4, -4);
  27.     curvature = (r.bottom - r.top) / 2 + 2;
  28.     GetPenState (&penState);
  29.     PenNormal ();
  30.     PenPat ((ConstPatternParam) &SkelQD (white));
  31.     PenSize (3, 3);
  32.     FrameRoundRect (&r, curvature, curvature);
  33.     SetPenState (&penState);
  34.     SetPort (oldPort);
  35. }
  36.